package com.srv.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.srv.TheException;
import com.srv.model.User;
import com.srv.service.TravelService;

public class ServletTravelDel extends HttpServlet {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1999999999L;
	private static Log log = LogFactory.getLog(ServletTravelDel.class);
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		try{
			response.setContentType(ConstText.TextHtml);
			ResponseResult result = new ResponseResult();
			User theUser = RequestTool.getAccessUser(request);
			//未登陆
			if(theUser==null){				
				result.theResult = ResponseResult.RESULT_FAIL;//结果失败
				result.theMessageObj = ConstText.NotLogin;
				ResponseTool.repsone(request,response,result);
				return;
			}									
			TravelService.del(request.getParameter(ConstText.Id));								
			ResponseTool.repsone(request,response,result);
			
		}catch(TheException te){
			log.error(te.getMessage());
		}
		
	}

}
